package com.yanyeori.singleton;

/**
 * @author chenkuan
 * @desc 饿汉模式
 * @date 2021/4/9 009 16:51
 */
public class HungrySingleton {
    /**
     * 类实例、调用静态变量、静态方法时才会发生类加载
     */
    private static HungrySingleton instance = new HungrySingleton();

    private HungrySingleton() {
    }

    public static HungrySingleton getInstance() {
        return instance;
    }
}
